package com.we823.project.common.web.status;

public enum LogType {
	NoType("999","未分类"),LoginSuccess("000","登录成功"),LoginFailure("001","登录失败"),NoAuthorition("002","无权限操作"),
	PlanCreate("003","计划创建"),
	PlanCofirm("004","确认计划"),
	ApplyMaterial("005","申请物料"),
	StockOut("006","物料出库"),
	StockIn("007","物料入库"),
	StockReturn("008","物料返库"),
	ShortError("009","短暂故障");
	private String code;
	private String message;
	
	private LogType(String code,String message) {
		this.code=code;
		this.message=message;
	}
	
	public String getCode() {
		return this.code;
	}
	
	public String getMessage() {
		return this.message;
	}
	
	public static LogType parse(String code) {
		LogType resulType = NoType;
		
		LogType[] logTypes = LogType.values();
		if (logTypes!=null && logTypes.length>0) {
			for (LogType logType : logTypes) {
				if (code.equals(logType.getCode())) {
					resulType = logType;
					break;
				}
			}
		}
		return resulType;
	}
	
}
